package com.yootk.main;

import com.yootk.di.config.MessageConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

public class FileSpringApplication { // Spring容器的启动类
    private static final Logger LOGGER = LoggerFactory.getLogger(FileSpringApplication.class);
    public static void main(String[] args) {
        // 容器的启动需要使用到特定的接口和类，此时的配置文件保存在CLASSPATH路径下，所以直接使用此类实例化
        ConfigurableApplicationContext context =
                new FileSystemXmlApplicationContext("f:\\spring-base.xml");
        ConfigurableEnvironment environment = context.getEnvironment();
        LOGGER.info("当前使用的JDK版本：{}",environment.getProperty("java.specification.version"));
    }
}

